import React, { ComponentProps } from 'react'
import { NavBar } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'

const PageHeader: React.FC<ComponentProps<any>> = ({ children,...props }) => {
    const navigate = useNavigate()
    return (
        <NavBar {...props} onBack={() => navigate(-1)}>{children}</NavBar>
    )
}

export default PageHeader